+ Operator

Used to sum two numbers or concatenate two String values.


Syntax

The + operator has two syntaxes:

result=expression1 + expression2

PartTypeDescription
result Number The sum of expression1 and expression2.
expression1 Number Any numeric expression.
expression2 Number Any numeric expression.

result=expression1 + expression2

PartTypeDescription
result String The concatenation of expression1 and expression2.
expression1 String Any string expression.
expression2 String Any string expression.


Notes

You can use Operator_Add to define the + operator for custom classes.


Examples

This example adds several numbers together:

Dim x as Integer
x=1+2+3

This example concatenates two strings and stores the result in a variable:

Dim name as String
name="REAL"+"basic" //name = REALbasic

See Also

Operator_Add, Str, Val functions.